import ajax from "@/utils/ajax";

export async function areaTree(params: any) {
    return ajax({
        url: `/area/tree`,
        method: 'POST',
        data: params,
        headers: {
            'city': params.city
        }
    });
}

export async function insert(params: any) {
    return ajax({
        url: `/area/insert`,
        method: 'POST',
        data: params,
    });
}

export async function update(params: any) {
    return ajax({
        url: `/area/update`,
        method: 'PUT',
        data: params,
    });
}

export async function deleteById(params: any) {
    return ajax({
        url: `/area/delete/${params}`,
        method: 'DELETE',
    });
}

/**
 * 生成二维码
 * @param params
 */
export async function genQrCode(params: any) {
    return ajax({
        url: `/gen/code`,
        method: 'GET',
        params: params
    });
}

/**
 * 生成二维码
 * @param params
 */
export async function batchGenQrCode(params: any) {
    return ajax({
        url: `/batch/gen/code`,
        method: 'GET',
        params: params
    });
}
